﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// xwd：2012-10-12
/// </summary>
namespace WeChat.Core.Common
{
    public class WeChatException : ApplicationException
    {
        public WeChatException(int errCode, string errMsg)
        {
            ErrCode = errCode;
            ErrMsg = errMsg;
        }

        public WeChatException(WeChatBasicRs ret)
        {
            ErrCode = ret.ErrCode;
            ErrMsg = ret.ErrMsg;
        }

        public int ErrCode { get; private set; }

        public string ErrMsg { get; private set; }

        /// <summary>
        /// 获取描述当前异常的消息。
        /// </summary>
        /// <returns>
        /// 解释异常原因的错误消息或空字符串 ("")。
        /// </returns>
        public override string Message
        {
            get { return ErrMsg; }
        }
    }
}